package com.chahu.handler;

import com.chahu.vo.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class AllExceptionHandler {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result<String> doException(Exception ex){
        ex.printStackTrace();
        return Result.error(-999, "系统异常");
    }
}
